<script setup>
import { ref } from "vue";
import { getQuestionTypeList, addReport, uploadphoto } from '@/api/report'
import myBack from '@/components/back.vue'
import { onMounted, onUnmounted } from 'vue';
// import { useRouter } from 'vue-router';


document.addEventListener('plusready', function() {
    var webview = plus.webview.currentWebview();
    plus.key.addEventListener('backbutton', function() {
        webview.canBack(function(e) {
            if(e.canBack) {
                webview.back();
            } else {
                webview.close(); //hide,quit
                //plus.runtime.quit();
            }
        })
    });
});

const result = ref('');
const showPicker = ref(false);

// const router = useRouter();

let inputtabstatus1 = ref(true)
let inputtabstatus2 = ref(false)


let tabClick = (type) => {
    if (type == 0) {
        console.log('00000')
        inputtabstatus1.value = true
        inputtabstatus2.value = false
    } else if (type == 1) {
        console.log('11111')
        inputtabstatus1.value = false
        inputtabstatus2.value = true

    }
}


onMounted(() => {
    console.log('组件挂载了');
    document.body.style.backgroundColor = '#f0f0f0';
});

onUnmounted(() => {
    console.log('组件即将销毁');
    // 当组件卸载时执行
    document.body.classList.remove('#app');
    const storage = window.localStorage
    storage.clear()
});



</script>

<template>
    <div class="login-body">
        <myBack class="my-back" />

        <!-- <img class="logo" src="../../assets/img/feedback01.png" alt=""> -->

        <div class="login-app">
            <!-- 选择登录方式部分 -->
            <input type="radio" name="opt" id="msg" checked="checked">
            <label for="msg" class="m-btn">短信登录</label>

            <input type="radio" name="opt" id="uname">
            <label for="uname" class="u-btn">账号登录</label>

            <!-- 登录表单部分 -->
            <div id="form-bar">
                <!-- 短信登录表单 -->
                <form class="m-form">
                    <input type="text" placeholder="请输入手机号">
                    <input type="text" placeholder="请输入验证码">
                    <button class="get-btn">获取验证码</button>
                    <input type="checkbox" id="sure">
                    <label for="sure" class="besure">
                        <p>未注册手机登录时会自动创建账号,我已阅读同意

                            <a >服务协议</a>
                            和
                            <a >隐私条款</a>
                        </p>

                    </label>
                    <button class="login-btn">登录</button>
                </form>
                <form class="u-form">账号登录</form>
            </div>

        </div>
    </div>


</template>

<style src="./index.css" scoped></style>